/**
 * Created with IntelliJ IDEA.
 *
 * @author: cxs
 * @date: 2023/6/26
 * @time: 17:19
 * @className：AccountController
 * @description：
 */
package com.bailan.sys.controller;

import com.bailan.common.util.ResultObj;
import com.bailan.sys.service.AccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class AccountController {
    @Autowired
    private AccountService service;
    @Transactional
    @PostMapping("in")
    public ResultObj accountTransfer(String inName, String outName, double money){
        int status=service.updateTransfer(inName,outName,money);
        if (status>0){
            return ResultObj.UPDATE_SUCCESS;
        }else{
            return ResultObj.UPDATE_ERROR;
        }
    }
}
